home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sun Solutions 2000 #2
/
Sun Solutions CD (Volume 2 2000)(Special Focus - Java Technologies)(Disc 1).ISO
/
products
/
Software
/
BostonBusinessComputing
/
bbc
/
install
< prev
next >
Wrap
Text File
|
2000-02-11
|
6KB
|
258 lines
#!/bin/sh
test "/$argv[0]" = "/" && exec /bin/sh $0 $argv
(a=1; unset a) 2>/dev/null || {
[ "`uname -s 2>/dev/null`" = "ULTRIX" ] &&\
exec /bin/sh5 -$- $0 ${@+"$@"}
}
umask 22
options="help
nocheck
nolic
noprev
noquick
quick
rootok
noasklic"
idlist() {
awk '/^[A-Za-z][^ ]*[ ]*-/ {print $1}' \
${@+"$@"} | sort -u
}
prodinfo() {
arg1=$1
lookfor=$1
NPRODS=0
PRODUCTS=""
NETWORKED=""
PRODDISTFILES=""
for f in $instdir/ID.*; do
case $f in "$instdir/ID.*") return 1;; esac
set -$- `awk 'NR==1{print $2, $3, $4, $5}' $f`
PRODUCTS="$PRODUCTS $1"
NPRODS=`expr $NPRODS + 1`
[ "$4" != 'N' ] && NETWORKED=y
if [ -z "$lookfor" -o "$1" = "$lookfor" ]; then
lookfor=$1
PRODNAME=$1
PRODDISP="$1"
PRODVER=$3
PRODNN=$4
PRODFILE=`echo $PRODNAME | tr '[A-Z]' '[a-z]' | sed 's/[^a-z0-9]//g'`
fi
done
if [ -z "$arg1" ]; then
PRODDISTFILES="`idlist $instdir/ID.*`"
if [ "$NPRODS" -gt 1 ]; then
PRODNAME='the products'
PRODDISP='the products'
PRODVER=''
PRODNN=''
PRODFILE=''
fi
fi
set -$- $PRODUCTS
export PRODNAME PRODDISP PRODVER PRODNN PRODFILE PRODUCTS \
PRODDISTFILES NPRODS NETWORKED
}
setprot() {
awk '/^[A-Za-z][^ ]*[ ]*-/ {file = 1}
{if (!file) next; file = 0; if (f[$1]) next; f[$1] = 1}
{if ((s = index($1, "/")) && !f[d = substr($1, 1, s - 1)]) {
f[d] = 1; c[755] = c[755] " " d }}
/[Mm]essage/||/[Mm]anual/||/[Dd]iskette/||/[Tt]his file/||/[Rr]elease notes/ {perm = 444}
/[Ii]nitialization/||/[Ss]tandard/||/[Dd]efinitions/||/[Cc]onfig/||/[Hh]elp text/ {perm = 644}
/[Ee]xecutable/||/[Dd]aemon/ {perm = 555}
/[Pp]rocedure/||/[Ss]cript/||/[Ff]ilter/ {perm = 755}
/dist\// {if (perm >= 600) perm -= 200}
{c[perm] = c[perm] " " $1}
END {for (m in c) print "chmod " m c[m]}' \
$instdir/ID.* | (cd bbc; sh -s)
}
unc() {
for f in `find $instdir -name '*.Z' -print`; do
case "$f" in
*.tar.?) compress -dfc $f | tar xf -
rm -f $f
;;
*) compress -df $f
;;
esac
done
}
bye() {
wait
exit 1
}
instdir=`dirname $0`
case "$instdir" in
''|.) instdir=`pwd`;;
/*) ;;
*) instdir=`(cd $instdir; pwd)`;;
esac
for f do
eval $f=:
done
for f in $options; do
eval '[ -z "$'$f'" ] && '$f'=false'
done
quickarg=:
$noquick && quickarg=false
PATH=$instdir:$PATH; export PATH
$help && {
tbput display "The following options are available:
$options
"
exit 0
}
BBCFILES=$instdir; export BBCFILES
[ -d $BBCFILES ] || {
echo "This program must be run from the directory (/tmp) in which you extracted
files using the 'tar' command.
Please try again from that directory."
exit 1
}
trap bye 2
whoami=`(whoami) 2>/dev/null || (id | sed 's/^[^(]*(\([^)]*\)).*/\1/')`
error=false
$rootok || if [ "$whoami" != "root" ] ; then
tbput clear display 'You must be logged in as \broot\B to successfully perform this
install procedure. If you are not logged in as super user, you will see
error messages displayed due to the placement of the distribution files.
If you \breally\B think this will not be a problem you can restart the
installation procedure with "'$0' rootok".
'
exit 1
fi
$nocheck || while : ; do
if (:>$instdir/.rw) 2>/dev/null; then
rm $instdir/.rw
rw=:
chmod 755 $instdir/compress $instdir/tbput 2>/dev/null
else
rw=false
fi
tbput clear display "Verifying your distribution..."
unc
prodinfo
$rw && setprot
if [ -z "$NPRODS" -o "$NPRODS" -lt 1 ]; then
tbput display "
Error attempting to process the files in this distribution.
No product files detected.
"
error=:
break
fi
msg="
The following files are missing or unreadable:
"
for f in $PRODDISTFILES; do
matched=false
for g in $instdir/$f; do
[ -r $g ] && {
matched=:
break
}
done
$matched && continue
tbput display "$msg"
msg=''
echo " $f"
done
if [ -n "$msg" ]; then
msg="done"
else
msg="
It appears that some expected files are missing from the
$instdir directory. The list of expected files was
derived from any ID.* files in this directory.
If you received multiple diskettes containing your product
distribution please make sure you have extracted all files from
all of the diskettes before proceeding with this installation.
To extract the files use the tar command documented in the
Installation Guide.
If you think that you have extracted all files correctly,
please call our Technical Support department."
error=:
fi
tbput display "$msg
"
break
done
$error && exit 1
$noquick || $quick || tbput display '
A quick installation automatically places your products in default
locations inferred from your system layout. A detailed installation
allows you to override these defaults. To perform a detailed
installation, press CTRL-C now and restart the installation with
"'$0' noquick".
Press ENTER to perform a quick installation: ' pause
tbput clear
bbc setup $quickarg $noprev
$nolic || {
if $noasklic; then
bbc license :
else
licensing=:
trap 'licensing=false' 2
tbput display '
Press ENTER to continue with product licensing
or abort now with CTRL-C: ' pause clear
trap bye 2
$licensing && bbc license :
fi
}
: ${BBCETC=/etc}
: ${BBCLICDIR=$BBCETC/bbc}
. $BBCLICDIR/config
torun=; for f in $BBCFILES/ID.*; do
name=`expr $f : '.*/ID\.\(.*\)'`
bin=`sed -ne 's/\(.*\)\.x.*- '$name' executable/\1/p' $f`
torun="$torun
Type \\b$bin\\B to run $name."
done
tbput display "Installation is complete.
$torun
Type \\bbbc contact\\B to view Boston Business Computing contact information.
Please take a moment to inspect the README.* files in $BBC.
They contain valuable information about your installation that is not
necessarily covered in your manual.
"